
<?php if(isset($product)): ?>
    <div class="product-box">
        <div class="product-box-content">
            <a class="product-thumb product-detail-popup" href=<?php echo $this->createUrl('categories/show',array('id' => $product->id,'layout' => 'ProductPopupLayout')); ?>>
                <img src= <?php echo UrlHelper::productImage($product->image); ?> />
            </a>
            <div class="clearfix"></div>
            <h2 class="product-title">
                <a class="product-detail-popup" href=<?php echo $this->createUrl('categories/show',array('id' => $product->id,'layout' => 'ProductPopupLayout')); ?>>
                    <?php echo $product->name; ?>
                </a>
            </h2>
            <div class="product-price text-center">
                <span class="price"><?php  echo Yii::app()->format->number($product->on_sale); ?></span>
                <span class="currency">VNĐ</span>
            </div>

            <div class="add-to-cart text-center">
                <a class="jsc-add-to-cart" href="<?php echo $this->createUrl('/cart/addToCart',array('product_id'=>$product->id)); ?>">+ <?php echo Yii::t("view_partials_productBox", "ADD TO CART"); ?></a>
            </div>
        </div>
    </div>
<?php else: ?>
    <div class="product-box">
        <div class="product-box-content">
            <p>Can't load content!</p>
        </div>
    </div>
<?php endif; ?>

<script type="text/javascript">
    $('.product-detail-popup').colorbox({width: 830, close: "<i class='fa fa-times'></i>", height:"90%"});
</script>

<script type="text/javascript">
    jQuery(document).ready(function(){
        $(document).bind('cbox_open', function() {
            $('html').css({ overflow: 'hidden' });
        }).bind('cbox_closed', function() {
            $('html').css({ overflow: '' });
        });
    });
</script>